home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.7 KB | 58 lines | [TEXT/GEOL] |
- Item 4707440 21-June-90 16:28PDT
-
- From: VANPATTEN Van Patten, Don
-
- To: MACAPP.TECH$ MacApp Technical
-
- cc: VANPATTEN Van Patten, Don
-
- Sub: CatchFailures and Methods
-
- I am new to C++ and would like to use the error trapping mechanisms available
- with MacApp. I want to make the error handler I am using part of an object.
- However, I get the error described below when I try to pass the method in the
- same way I would if it were a standard pascal void (*). I would appreciate
- being educated in this area.
-
- My situation is described below:
-
- As defined in "UFailure.h":
- CatchFailures (FailInfo *fi,
- pascal void (*Handler)(short e, long m, void* Handler_StaticLink),
- void *Handler_StaticLink);
-
- Declaration of method in my object:
- public:
- pascal virtual void StandardErrorHandler (short error_num,
- long error_message,
- void* Handler_StaticLink);
-
- Definition of method:
- pascal void TErrorManager::StandardErrorHandler (short error_num,
- long error_message,
- void* Handler_StaticLink)
- {
- /* code */
- }
-
- Attempted use of method as a parameter:
- CatchFailures (&fail_info,
- &(gErrorManager->StandardErrorHandler),
- errorBuf);
-
- Compiler offense:
- # warning: address of bound function
- (try using ``TErrorManager ::*'' for pointer type
- and ``&TErrorManager ::StandardErrorHandler '' for address)
-
- # error: bad argument 2 type for CatchFailures():
- pascal void (TErrorManager:: *)(short , long , void *)
- ( pascal void (*)(short , long , void *) expected)
-
- I have tried the suggestion given by the warning and even attempted to cast the
- parameter but have been unsuccessful.
-
- Thanks in advance,
- Don Van Patten
-
-